<script setup>
import { DropdownMenuRadioItem, DropdownMenuItemIndicator } from 'radix-vue'
import { CircleIcon } from 'lucide-vue-next'
import { cn } from '../../utils'

const props = defineProps({
  class: { type: String, required: false },
})
</script>

<template>
  <DropdownMenuRadioItem
    v-bind="$attrs"
    :class="cn(
      'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
      props.class,
    )"
  >
    <span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
      <DropdownMenuItemIndicator>
        <CircleIcon class="h-2 w-2 fill-current" />
      </DropdownMenuItemIndicator>
    </span>
    <slot />
  </DropdownMenuRadioItem>
</template>
